/**
 * Created by Wilson on 3/16/2015.
 */
(function () {
    angular.module('app')
        .controller('paymentResultController', paymentResultController);

    paymentResultController.$inject = ['$scope'];
    function paymentResultController($scope) {
        $scope.activeStar = activeStar;

        $scope.activeCnt = 4;

        $scope.starList = [{
            name: 'star-active'
        }, {
            name: 'star-active'
        }, {
            name: 'star-active'
        }, {
            name: 'star-active'
        }, {
            name: 'star-inactive'
        }
        ];

        function activeStar(count) {
            $scope.activeCnt = count;
            for (var i = 0; i < 5; i++) {
                if (i < count) {
                    $scope.starList[i].name = 'star-active';
                } else {
                    $scope.starList[i].name = 'star-inactive';
                }
            }
        }
    }
})();